<!DOCTYPE html>
<html>
  <head>
    <title>Malarkey</title>
    <meta charset="utf-8">
  </head>
  <body>
    <div class="malarkey"></div>
    <script src="../dist/malarkey.min.js"></script>
    <script>
      var elem = document.querySelector('.malarkey');
      var opts = {
        typeSpeed: 50,
        deleteSpeed: 50,
        pauseDelay: 2000,
        loop: true,
        postfix: ''
      };
      var m = malarkey(elem, opts).type('Say hello')   .pause().delete()
                                  .type('Wave goodbye').pause().delete();
      document.addEventListener('click', function() {
        if (m.isRunning()) {
          m.triggerPause();
          elem.style.color = 'red';
        } else {
          m.triggerResume();
          elem.style.color = 'black';
        }
      });
    </script>
  </body>
</html>
